using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._AnalysisTools
{
    /// <summary>
    /// <para>Geographically Weighted Regression</para>
    /// <para>Calculates Geographically Weighted Regression.</para>
    /// <para>计算地理加权回归。</para>
    /// </summary>    
    [DisplayName("Geographically Weighted Regression")]
    public class GeographicallyWeightedRegression : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public GeographicallyWeightedRegression()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input features</para>
        /// <para></para>
        /// <para></para>
        /// </param>
        /// <param name="_dependent_field">
        /// <para>Dependent variable</para>
        /// <para></para>
        /// <para></para>
        /// </param>
        /// <param name="_explanatory_field">
        /// <para>Explanatory variable(s)</para>
        /// <para></para>
        /// <para></para>
        /// </param>
        /// <param name="_out_featureclass">
        /// <para>Output feature class</para>
        /// <para></para>
        /// <para></para>
        /// </param>
        /// <param name="_kernel_type">
        /// <para>Kernel type</para>
        /// <para></para>
        /// <para></para>
        /// </param>
        /// <param name="_bandwidth_method">
        /// <para>Bandwidth method</para>
        /// <para></para>
        /// <para></para>
        /// </param>
        public GeographicallyWeightedRegression(object _in_features, object _dependent_field, List<object> _explanatory_field, object _out_featureclass, _kernel_type_value _kernel_type, _bandwidth_method_value _bandwidth_method)
        {
            this._in_features = _in_features;
            this._dependent_field = _dependent_field;
            this._explanatory_field = _explanatory_field;
            this._out_featureclass = _out_featureclass;
            this._kernel_type = _kernel_type;
            this._bandwidth_method = _bandwidth_method;
        }
        public override string ToolboxName => "Analysis Tools";

        public override string ToolName => "Geographically Weighted Regression";

        public override string CallName => "analysis.GeographicallyWeightedRegression";

        public override List<string> AcceptEnvironments => [];

        public override object[] ParameterInfo => [_in_features, _dependent_field, _explanatory_field, _out_featureclass, _kernel_type.GetGPValue(), _bandwidth_method.GetGPValue(), _distance, _number_of_neighbors, _weight_field, _coefficient_raster_workspace, _cell_size, _in_prediction_locations, _prediction_explanatory_field, _out_prediction_featureclass, _out_table, _out_regression_rasters];

        /// <summary>
        /// <para>Input features</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Dependent variable</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Dependent variable")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _dependent_field { get; set; }


        /// <summary>
        /// <para>Explanatory variable(s)</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Explanatory variable(s)")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _explanatory_field { get; set; }


        /// <summary>
        /// <para>Output feature class</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output feature class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_featureclass { get; set; }


        /// <summary>
        /// <para>Kernel type</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Kernel type")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _kernel_type_value _kernel_type { get; set; }

        public enum _kernel_type_value
        {
            /// <summary>
            /// <para>FIXED</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("FIXED")]
            [GPEnumValue("FIXED")]
            _FIXED,

            /// <summary>
            /// <para>ADAPTIVE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ADAPTIVE")]
            [GPEnumValue("ADAPTIVE")]
            _ADAPTIVE,

        }

        /// <summary>
        /// <para>Bandwidth method</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Bandwidth method")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _bandwidth_method_value _bandwidth_method { get; set; }

        public enum _bandwidth_method_value
        {
            /// <summary>
            /// <para>AICc</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("AICc")]
            [GPEnumValue("AICc")]
            _AICc,

            /// <summary>
            /// <para>CV</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("CV")]
            [GPEnumValue("CV")]
            _CV,

            /// <summary>
            /// <para>BANDWIDTH_PARAMETER</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("BANDWIDTH_PARAMETER")]
            [GPEnumValue("BANDWIDTH_PARAMETER")]
            _BANDWIDTH_PARAMETER,

        }

        /// <summary>
        /// <para>Distance</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Distance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double? _distance { get; set; } = null;


        /// <summary>
        /// <para>Number of neighbors</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Number of neighbors")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _number_of_neighbors { get; set; } = 30;


        /// <summary>
        /// <para>Weights</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Weights")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _weight_field { get; set; } = null;


        /// <summary>
        /// <para>Coefficient raster workspace</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Coefficient raster workspace")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _coefficient_raster_workspace { get; set; } = null;


        /// <summary>
        /// <para>Output cell size</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output cell size")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _cell_size { get; set; } = null;


        /// <summary>
        /// <para>Prediction locations</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Prediction locations")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _in_prediction_locations { get; set; } = null;


        /// <summary>
        /// <para>Prediction explanatory variable(s)</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Prediction explanatory variable(s)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _prediction_explanatory_field { get; set; } = null;


        /// <summary>
        /// <para>Output prediction feature class</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output prediction feature class")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _out_prediction_featureclass { get; set; } = null;


        /// <summary>
        /// <para>Output table</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output table")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_table { get; set; }


        /// <summary>
        /// <para>Output regression rasters</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output regression rasters")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public List<object> _out_regression_rasters { get; set; }


        public GeographicallyWeightedRegression SetEnv()
        {
            base.SetEnv();
            return this;
        }

    }

}